
public class Car {
	int year;
	String make;
	String model;
	int milage = 0;
	boolean isNew = true;
	String owner = "None";
	
	public Car(){
		year = 0;
		make = "None";
		model = "None";
	}
	
	public Car(int year, String make, String model){
		this.year = year;
		this.make = make;
		this.model = model;
	}
	
	public boolean buyNew(People newOwner){
		if (this.isNew == true){
			this.owner = newOwner.getName();
			this.isNew = false;
			return true;
		}
		else{return false;}
	}
	
	public boolean buyUsed(People newOwner){
		if(this.isNew == false){
			this.owner = newOwner.name;
			return true;
		}
		else{return false;}
	}
	public String showCar(){
		String status = "Used";
		if(isNew==true){status = "New";}
		String carInfo = year+"/"+make+"/"+model+"/"+status+"/"+milage+"/"+owner;
		return carInfo;
	}
}
